/*
 *  Copyright 2001-2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package ar.uba.fi.posgrado.economy.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import ar.uba.fi.posgrado.common.model.AbstractDomainObject;

/**
 * Beneficio.<br>
 * Puede tener valor o porcentaje. Solo aplica uno.<br>
 * 
 * @author nicolas.gonzalez
 * @see AbstractDomainObject
 */
@Entity
@Table(name = "BENEFICIO")
@SuppressWarnings("serial")
public class Benefit extends AbstractDomainObject {
    
    @Column(name = "DESCRIPCION", length = 45, unique = true)
    private String description;
    
    @Column(name = "PORCENTAJE")
    private Double percentage;
    
    @Column(name = "VALOR")
    private Double value;
    
    @Column(name = "VIGENCIA_DESDE")
    private Date validFrom;
    
    @Column(name = "VIGENCIA_HASTA")
    private Date validTo;

    // Por defecto es activo
    @Column(name = "ESTADO")
    private BenefitStatus status = BenefitStatus.Active;
    
    /**
     * @see ar.uba.fi.posgrado.common.model.AbstractDomainObject#getExcludedFields()
     */
    @Override
    public String[] getExcludedFields() {
        return new String[]{"percentage", "value", "validFrom", "validTo", "status"};
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return this.description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the percentage
     */
    public Double getPercentage() {
        return this.percentage;
    }

    /**
     * @return the value
     */
    public Double getValue() {
        return this.value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(Double value) {
        this.value = value;
    }

    /**
     * @return the validFrom
     */
    public Date getValidFrom() {
        return this.validFrom;
    }

    /**
     * @param validFrom the validFrom to set
     */
    public void setValidFrom(Date validFrom) {
        this.validFrom = validFrom;
    }

    /**
     * @return the validTo
     */
    public Date getValidTo() {
        return this.validTo;
    }

    /**
     * @param validTo the validTo to set
     */
    public void setValidTo(Date validTo) {
        this.validTo = validTo;
    }

    /**
     * @param percentage the percentage to set
     */
    public void setPercentage(Double percentage) {
        this.percentage = percentage;
    }

    /**
     * @return the status
     */
    public BenefitStatus getStatus() {
        return this.status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(BenefitStatus status) {
        this.status = status;
    }


}
